import time

from base.Base import Base

from selenium.webdriver.common.by import By

class Page(Base):
    iframe = (By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe')
    username = (By.NAME,'email')
    password=(By.NAME,'password')
    login = (By.ID,'dologin')
    read = (By.XPATH,'/html/body/div[1]/nav/div[1]/ul/li[2]/span[2]')
    send = (By.CLASS_NAME,'nui-editableAddr-ipt')
    zhti=(By.XPATH,'/html/body/div[2]/div[1]/div[2]/div[1]/section/header/div[2]/div[1]/div/div/input')
    xinxi=(By.CLASS_NAME,'nui-scroll')
    send_keys_click=(By.CLASS_NAME,'nui-btn-text')


    def iframe_01(self):
        self.frame(self.iframe)
    def username_02(self):
        self.send_keys(self.username,'15232008902')
    def password_03(self):
        self.send_keys(self.password,'ma820116.')
    def login_04(self):
        self.click(self.login)

    def read_05(self):
        self.click(self.read)

    def send_06(self):
        self.send_keys(self.send,'2410811597@qq.com')
    def zhti_07(self):
        self.send_keys(self.zhti,'月考')
    def xinxi_08(self):
        self.send_keys(self.xinxi,'月考内容')
    def send_keys_click_09(self):
        self.click(self.send_keys_click)


    def email_luoji(self):
        self.open_url('https://mail.163.com/')
        self.iframe_01()
        self.username_02()
        self.password_03()
        self.login_04()
        time.sleep(5)
        # self.read_05()
        # self.send_06()
        # self.zhti_07()
        # self.xinxi_08()
        # self.send_keys_click_09()

